package com.fenghuajueli.module_home.db

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase

@Database(entities = [ClockinPlanEntity::class],
    version = 1,exportSchema = false)
abstract class AppDatabase : RoomDatabase() {

    abstract fun clockinPlanDao(): ClockinPlanDao

    companion object {
        private var instance: AppDatabase? = null

        fun getInstance(context: Context): AppDatabase {
            return instance ?: synchronized(this) {
                Room.databaseBuilder(context, AppDatabase::class.java,"clockinPlan.db")
                    .build().apply { instance = this }
            }
        }
    }
}